package org.example.flinktest.operators;

import org.apache.flink.api.common.functions.MapFunction;
import org.example.flinktest.bean.SensorReading;

/**
 * @author shihb
 * @date 2019/12/10 11:11
 */
public class MakeSensorMapFunction implements MapFunction<String, SensorReading> {

  @Override
  public SensorReading map(String s) throws Exception {
    String[] arr = s.split(",");
    return new SensorReading(arr[0],Long.parseLong(arr[1]),Double.parseDouble(arr[2]));
  }
}
